package com.bayleaf.web.xmlConverter;

import javax.servlet.annotation.WebInitParam;
import javax.servlet.annotation.WebServlet;

import net.sf.json.JSONObject;

import com.bayleaf.core.BayleafServlet;
import com.bayleaf.core.Model;

@WebServlet(name="mytest",
urlPatterns={"/XMLConverter"},
initParams={ @WebInitParam(name="title", value="XML Convert!!") } )
public class XMLConverter extends BayleafServlet {

	@Override
	public String process(Model model) throws Exception {
		// TODO Auto-generated method stub
		return null;
	}

	
	
	public JSONObject XMLToJson(String XMLStr){
//		JSONObject jsonObj = (JSONObject)new XMLSerializer().read(XMLStr);
		JSONObject jsonObj = new JSONObject();
		System.out.println(jsonObj.toString());
		return jsonObj;
	}
	
	
	public String JsonToXML(JSONObject jsonObj){
//		JSONObject jsonObj = js/*onStr;
//		String xml = new XMLSerializer().write(jsonStr);*/
		return "";
	}


}